interface _CS_ {
    /**
     * 转化为蛇节标识
     * @param str 字符串
     * @param separator <'_'> 分隔符
     * @returns 字符串
     */
    snakeCase(str: string, separator?: '_' | string): string;
}
{
    Object.defineProperty(_CS_.prototype, 'snakeCase', {
        writable: false,
        configurable: false,
        enumerable: false,
        value: (str: string, separator: string = '_') => {
            const result = [];
            let lower = false;
            for (let i = 0; i < str.length; i++) {
                const c = str[i];
                if (/[A-Z]$/.test(c) && lower) {
                    result.push(separator);
                    lower = false;
                } else if (/[a-z]$/.test(c)) {
                    lower = true;
                } else {
                    lower = false;
                }
                result.push(c);
            }
            return result.join('').toUpperCase();
        }
    });
}
